Skip to content

fix: correct ProviderValue typing, conftest docstring placement, and pool.py line formatting#22

Merged
mahimairaja merged 2 commits intocursor/split-cli-appfrom
copilot/sub-pr-21
Mar 22, 2026
Merged

fix: correct ProviderValue typing, conftest docstring placement, and pool.py line formatting#22
mahimairaja merged 2 commits intocursor/split-cli-appfrom
copilot/sub-pr-21

Conversation

Copy link
Contributor

Copilot AI commented Mar 22, 2026

Three code quality issues flagged in review: a type alias that was effectively Any, a module docstring that wasn't being recognized as such, and a formatter compliance issue.

Changes

  • provider_types.pystr | Any collapses to Any in all type checkers, making ProviderValue useless for precision. Changed to str | object; removed now-unused Any import.

    # before
    ProviderValue: TypeAlias = str | Any
    
    # after
    ProviderValue: TypeAlias = str | object
  • tests/conftest.py — Module docstring was placed after from __future__ import annotations, making it an unreachable string expression rather than __doc__. Moved above the future import.

  • pool.py — Ran ruff format; the if condition at line 631 is exactly 88 chars (at the configured line-length), so the formatter keeps it single-line and ruff format --check now passes cleanly.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

…ng, pool.py format

Co-authored-by: mahimairaja <81288263+mahimairaja@users.noreply.github.com>
Agent-Logs-Url: https://github.com/mahimairaja/openrtc-python/sessions/8aca67d0-da08-4745-899f-296a8db94b8b
Copilot AI changed the title [WIP] Refactor CLI to split cli_app into focused submodules fix: correct ProviderValue typing, conftest docstring placement, and pool.py line formatting Mar 22, 2026
Copilot AI requested a review from mahimairaja March 22, 2026 17:11
Copy link
Owner

@mahimairaja mahimairaja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mahimairaja mahimairaja marked this pull request as ready for review March 22, 2026 17:16
Copilot AI review requested due to automatic review settings March 22, 2026 17:16
@mahimairaja mahimairaja merged commit ace2436 into cursor/split-cli-app Mar 22, 2026
4 of 5 checks passed
@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.22%. Comparing base (626ca45) to head (7070680).
⚠️ Report is 3 commits behind head on cursor/split-cli-app.

Additional details and impacted files

Impacted file tree graph

@@                  Coverage Diff                  @@
##           cursor/split-cli-app      #22   +/-   ##
=====================================================
  Coverage                 90.22%   90.22%           
=====================================================
  Files                        13       13           
  Lines                      1361     1361           
=====================================================
  Hits                       1228     1228           
  Misses                      133      133           
Files with missing lines Coverage Δ
src/openrtc/provider_types.py 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 626ca45...7070680. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses three code-quality issues: improving the usefulness of ProviderValue typing, ensuring the tests/conftest.py module docstring is recognized correctly, and aligning pool.py formatting with ruff format.

Changes:

  • Adjust ProviderValue type alias in provider_types.py and remove the unused Any import.
  • Move tests/conftest.py module docstring above the from __future__ import annotations statement.
  • Apply ruff format output to pool.py (line-length compliance).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/conftest.py Moves module docstring to proper location so it is treated as __doc__.
src/openrtc/provider_types.py Updates ProviderValue alias and cleans up typing imports.
src/openrtc/pool.py Formatting-only change to satisfy ruff format --check.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +11 to +13
# ``object`` allows any third-party plugin class without enumerating them here;
# use strings when you want the type checker to stay precise.
ProviderValue: TypeAlias = str | object
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

str | object will be simplified by mypy to just object (since object is a supertype of str), so this alias still loses the intended “string vs provider object” precision. Consider either making the alias simply object and updating the comment accordingly, or introducing a narrower type/Protocol for provider instances so the union remains meaningful for type checking (and so ProviderValue | None doesn’t collapse to object).

Copilot uses AI. Check for mistakes.
@mahimairaja mahimairaja deleted the copilot/sub-pr-21 branch March 23, 2026 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants